<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Maven多模块项目的依赖管理</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
        }
        .serif-font {
            font-family: 'Noto Serif SC', serif;
        }
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-4px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .section-divider {
            background: linear-gradient(to right, transparent, #e5e7eb, transparent);
            height: 1px;
            margin: 3rem 0;
        }
        pre {
            background-color: #f3f4f6;
            border-radius: 0.5rem;
            padding: 1.5rem;
            overflow-x: auto;
            border-left: 4px solid #667eea;
        }
        code {
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 3rem;
            padding-right: 0.5rem;
            margin-top: 0.5rem;
            font-weight: 700;
            color: #667eea;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto">
            <div class="text-center">
                <h1 class="text-5xl md:text-6xl font-bold mb-6 serif-font">Maven多模块项目的依赖管理</h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90">在微服务与单体架构之间，寻找黄金平衡点</p>
                <div class="flex justify-center items-center space-x-6 text-lg">
                    <span><i class="fas fa-calendar-alt mr-2"></i>2025年1月</span>
                    <span><i class="fas fa-clock mr-2"></i>深度解析</span>
                    <span><i class="fas fa-layer-group mr-2"></i>架构设计</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Quote Section -->
    <section class="py-16 px-6 bg-white">
        <div class="max-w-4xl mx-auto">
            <blockquote class="relative">
                <div class="absolute -top-8 -left-4 text-6xl text-purple-200">"</div>
                <p class="text-2xl text-gray-700 italic leading-relaxed drop-cap">
                    当你的团队花两个月拆分微服务，却发现性能下降30%，部署复杂度暴增10倍时，你是否扪心自问：真的需要微服务吗？
                </p>
                <div class="absolute -bottom-8 -right-4 text-6xl text-purple-200">"</div>
            </blockquote>
        </div>
    </section>

    <!-- Key Insights -->
    <section class="py-16 px-6">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12 gradient-text">核心洞察</h2>
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white rounded-xl p-8 card-hover">
                    <div class="text-4xl text-purple-600 mb-4"><i class="fas fa-balance-scale"></i></div>
                    <h3 class="text-xl font-bold mb-3">架构平衡</h3>
                    <p class="text-gray-600">为何阿里巴巴早期电商平台选择多模块而非微服务？探索架构选择的智慧。</p>
                </div>
                <div class="bg-white rounded-xl p-8 card-hover">
                    <div class="text-4xl text-purple-600 mb-4"><i class="fas fa-puzzle-piece"></i></div>
                    <h3 class="text-xl font-bold mb-3">依赖管理</h3>
                    <p class="text-gray-600">dependencyManagement与pluginManagement的深度剖析，掌握Maven核心机制。</p>
                </div>
                <div class="bg-white rounded-xl p-8 card-hover">
                    <div class="text-4xl text-purple-600 mb-4"><i class="fas fa-rocket"></i></div>
                    <h3 class="text-xl font-bold mb-3">优化技巧</h3>
                    <p class="text-gray-600">揭秘那些鲜为人知的依赖优化技巧，让构建速度提升10倍。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Architecture Visualization -->
    <section class="py-16 px-6 bg-white">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12">多模块架构全景图</h2>
            <div class="mermaid">
                graph TB
                    A[Maven多模块项目] --> B[核心价值]
                    A --> C[依赖管理]
                    A --> D[项目结构]
                    A --> E[最佳实践]
                    
                    B --> B1[代码复用]
                    B --> B2[团队协作]
                    B --> B3[依赖隔离]
                    B --> B4[渐进式演进]
                    
                    C --> C1[dependencyManagement]
                    C --> C2[pluginManagement]
                    C --> C3[版本统一管理]
                    C --> C4[依赖冲突解决]
                    
                    D --> D1[父子工程]
                    D --> D2[模块划分]
                    D --> D3[API与实现分离]
                    D --> D4[避免循环依赖]
                    
                    E --> E1[增量构建]
                    E --> E2[并行构建]
                    E --> E3[安全扫描]
                    E --> E4[CI/CD集成]
                    
                    style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                    style B fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
                    style C fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
                    style D fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
                    style E fill:#9f7aea,stroke:#fff,stroke-width:2px,color:#fff
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto">
            <!-- Section 1 -->
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-8 flex items-center">
                    <span class="bg-purple-600 text-white rounded-full w-12 h-12 flex items-center justify-center mr-4">1</span>
                    多模块项目的核心价值
                </h2>
                
                <div class="bg-white rounded-xl p-8 mb-8">
                    <h3 class="text-2xl font-semibold mb-6 text-purple-700">多模块项目的定位</h3>
                    <p class="text-lg text-gray-700 leading-relaxed mb-6">
                        Maven多模块项目是在单体架构与微服务架构之间的绝佳平衡点。它允许我们在保持代码高内聚的同时，实现逻辑分层和功能解耦。多模块项目本质上是一种"内部拆分"的方式，通过模块化设计使复杂系统变得可管理，同时避免了微服务带来的分布式复杂性。
                    </p>
                    
                    <div class="bg-gray-50 rounded-lg p-6 mb-6">
                        <h4 class="font-semibold mb-3 text-purple-600"><i class="fas fa-folder-tree mr-2"></i>典型项目结构</h4>
                        <pre><code>project-parent
├── pom.xml
├── common-module
│   └── pom.xml
├── user-service
│   └── pom.xml
├── order-service
│   └── pom.xml
└── payment-service
    └── pom.xml</code></pre>
                    </div>
                </div>

                <div class="bg-white rounded-xl p-8 mb-8">
                    <h3 class="text-2xl font-semibold mb-6 text-purple-700">解决的核心问题</h3>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div class="flex items-start">
                            <i class="fas fa-recycle text-purple-600 text-2xl mr-4 mt-1"></i>
                            <div>
                                <h4 class="font-semibold mb-2">代码复用</h4>
                                <p class="text-gray-600">共享基础设施和通用组件，减少重复代码</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-users text-purple-600 text-2xl mr-4 mt-1"></i>
                            <div>
                                <h4 class="font-semibold mb-2">团队协作</h4>
                                <p class="text-gray-600">不同团队可以专注于不同模块的开发</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-shield-alt text-purple-600 text-2xl mr-4 mt-1"></i>
                            <div>
                                <h4 class="font-semibold mb-2">依赖隔离</h4>
                                <p class="text-gray-600">合理划分模块边界，避免过度耦合</p>
                            </div>
                        </div>
                        <div class="flex items-start">
                            <i class="fas fa-rocket text-purple-600 text-2xl mr-4 mt-1"></i>
                            <div>
                                <h4 class="font-semibold mb-2">渐进式演进</h4>
                                <p class="text-gray-600">为未来向微服务演进奠定基础</p>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="bg-purple-50 rounded-xl p-8 border-l-4 border-purple-600">
                    <h3 class="text-2xl font-semibold mb-4 text-purple-700"><i class="fas fa-building mr-2"></i>大厂实践案例</h3>
                    <p class="text-lg text-gray-700 leading-relaxed">
                        阿里巴巴在其电商平台早期采用了多模块Maven架构，将系统分为用户中心、商品中心、订单中心等核心模块。通过这种方式，他们在保持系统一致性的同时，实现了业务领域的解耦和独立演进。这种架构在支撑每年"双11"高并发场景时，展现出了强大的可扩展性。
                    </p>
                </div>
            </div>

            <div class="section-divider"></div>

            <!-- Section 2 -->
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-8 flex items-center">
                    <span class="bg-purple-600 text-white rounded-full w-12 h-12 flex items-center justify-center mr-4">2</span>
                    Maven依赖管理的基础机制
                </h2>

                <div class="bg-white rounded-xl p-8 mb-8">
                    <h3 class="text-2xl font-semibold mb-6 text-purple-700">依赖传递原理</h3>
                    <p class="text-lg text-gray-700 leading-relaxed mb-6">
                        Maven的依赖传递是指：当A依赖B，B依赖C，那么A会自动依赖C。这种机制大大简化了依赖管理，但也带来了依赖冲突的可能性。
                    </p>
                    
                    <div class="bg-yellow-50 rounded-lg p-6 border-l-4 border-yellow-400 mb-6">
                        <h4 class="font-semibold mb-3 text-yellow-800"><i class="fas fa-exclamation-triangle mr-2"></i>冲突示例</h4>
                        <p class="text-gray-700 mb-4">模块A依赖spring-core 5.3.9，而模块